﻿Public Class RadioGroupBy

    Private Sub ThongTinBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
        Me.Validate()
        Me.ThongTinBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.PCV_TutorialDataSet)

    End Sub

    Private Sub RadioGroupBy_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'PCV_TutorialDataSet.ThongTin' table. You can move, or remove it, as needed.
        Me.ThongTinTableAdapter.Fill(Me.PCV_TutorialDataSet.ThongTin)

    End Sub
    
    

    Private Sub RadioGroup1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RadioGroup1.SelectedIndexChanged
        setGrid()
    End Sub
    Private Sub setGrid()
        'Truong hop index = 0, group by ma, ten
        If Me.RadioGroup1.SelectedIndex = 0 Then
            Me.colma.Visible = True
            Me.colten.Visible = True
            Me.colma.GroupIndex = 1
            Me.colten.GroupIndex = 2
            Me.IGridView1.ExpandAllGroups()
            'truong hop index =1 , tong hop
        Else
            Me.colma.Visible = False
            Me.colten.Visible = False
            Me.colma.GroupIndex = -1
            Me.colten.GroupIndex = -1
        End If
    End Sub
End Class
